package io.renren.modules.avanotes.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;
import io.renren.modules.avanotes.dao.MindBookDao;
import io.renren.modules.avanotes.entity.MindBookEntity;
import io.renren.modules.avanotes.service.MindBookService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


//@Service("mindBookService")//默认只有一个实现，那就不写名称了直接使用默认的名称！
@Service
public class MindBookServiceImpl extends ServiceImpl<MindBookDao, MindBookEntity> implements MindBookService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<MindBookEntity> page = this.page(
                new Query<MindBookEntity>().getPage(params),
                new QueryWrapper<MindBookEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public List<MindBookEntity> list4SelectByTitle(String keyword) {
        List<MindBookEntity> list = this.list(new QueryWrapper<MindBookEntity>().like(MindBookEntity.CN_NAME, keyword));
        return list;
    }

}